package com.hrt.datasender.web.bcsite;

import java.io.IOException;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.btcode.web.core.annotation.RequestMapping;
import com.btcode.web.core.controller.Controller;
import com.hrt.common.web.DSRequestUnit;
import com.hrt.datasender.datadao.model.BcSiteModel;
import com.hrt.datasender.datadao.service.BCSiteService;

@RequestMapping(path = "BCSite")
public class BCSiteController extends Controller {

    @RequestMapping(path = "getModel")
    public void getModel(ServletRequest arg0, ServletResponse arg1) throws IOException {

        BcSiteModel model = BCSiteService.getInstance().getModel();

        success(model);
    }

    @RequestMapping(path = "saveModel")
    public void saveModel(ServletRequest arg0, ServletResponse arg1) throws IOException {

        BcSiteModel model = DSRequestUnit.getModel(BcSiteModel.class);
        BCSiteService.getInstance().save(model);
        success(model);
    }

}
